#ifndef _NUC_H
#define _NUC_H

#include <cmsis_os2.h>
#include "device.h"
#include "bsp_usart.h"
#include "cmd.h"
#include "protocol.h"




typedef struct {
  uint8_t id;
  Protocol_UpPackageMCU_t package;
} NUC_UpPackageMCU_t;

typedef struct {
  osThreadId_t thread_alert;

  Protocol_DownPackageChassis_t Nucfor_chassis; //接收的数据协议

  NUC_UpPackageMCU_t to_nuc; //发送的数据协议

  uint8_t status;//控制状态
} NUC_t;


int8_t NUC_Init(NUC_t *nuc);
int8_t NUC_StartReceiving(NUC_t *nuc);
bool_t NUC_WaitDmaCplt(void);
int8_t NUC_ParserawData(NUC_t *n);
int8_t NUC_ParseforChassis(CMD_NUC_t *cmd,NUC_t *from_nuc);
int8_t NUC_HandleOffline(NUC_t *nuc, CMD_NUC_t *cmd_nuc);
#endif

